<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>船公司信息 - TMS</title>
    <link rel="stylesheet" href="/view/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/view/frame/static/css/global.css?v=1.0">
    <link rel="stylesheet" href="/view/tms/static/css/iframe.css?v=1.0">
  </head>
  <body>
    <!--start: 搜索-->
    <div class="panel-handle search-bar">
      <form class="layui-form layui-form-pane">
        <div class="layui-inline">
          <div class="layui-input-inline">
            <select name="exact" id="exact">
              <option value="0" selected="selected">模糊查询</option>
              <option value="1">精确查询</option>
            </select>
          </div>
        </div>
        <div class="layui-inline">
          <div class="layui-input-inline">
            <select name="type" id="type">
              <option value="0" selected="selected">船公司代码</option>
              <option value="1">船公司名称</option>
            </select>
          </div>
        </div>
        <div class="layui-inline">
          <div class="layui-input-inline">
            <input type="text" name="name" id="name" lay-verify="title" autocomplete="off" placeholder="" class="layui-input">
          </div>
        </div>
        <button type="button" class="layui-btn layui-btn-danger" lay-submit lay-filter="search"><i class="layui-icon">&#xe615;</i>查询</button>
      </form>
    </div>
    <!--end: 搜索-->

    <!--start:表格列表-->
    <table class="layui-hide" id="table_list"></table>
    <!--end:表格列表-->
  </body>
  <script charset="utf-8" src="/view/frame/layui/layui.js"></script>
  <script charset="utf-8" src="/view/frame/static/js/jquery.min.js?v=1.0"></script>
  <script charset="utf-8" src="/view/frame/static/js/jquery.cookie.min.js?v=1.0"></script>
  <script charset="utf-8" src="/view/tms/static/js/tms_comm.js?v=1.0"></script>
  <script charset="utf-8" src="/view/tms/static/js/tms_index.js?v=1219"></script>
  <script charset="utf-8" src="/view/frame/static/js/tms_common/utils.js?v=1.0"></script>
  
  <script charset="utf-8" src="/view/frame/static/js/errorCodeMap.js"></script>
  <script charset="utf-8" src="/view/frame/static/js/HC.js?v=1.4"></script>
  <script charset="utf-8" src="/view/tms/static/js/validator.js"></script>
  <script charset="utf-8" src="/view/tms/static/js/bizUtil.js"></script>
  
  <script>
  layui.use(['form', 'layer', 'table'], function(){
    var $form = layui.form,
        $layer = layui.layer,
        $table = layui.table,
        $ = layui.jquery;

    var options = {
      "seachOptions":{
        "rely": $form,
        "condition": ["exact","type","name"],
        "getParameter": ""
      },

      "tableOptions": {
        cols: [[
          {field:'scacCode', title: 'SCAC代码', width:120, sort: true},
          {field:'shippingCode', title: '船公司代码', width:120, templet: '#usernameTpl'},
          {field:'shippingFullname', title: '船公司全称', width:300},
          {field:'shippingName', title: '船公司简称', width:120},
          {field:'shippingNameEn', title: '英文全称', width:300},
          {field:'website', title: '公司网站', width:200},
          {field:'contaCode', title: '箱主代码', width:120}
        ]],
        url: '/ucenter/code/common/shipping/page.shtml',
        where: {"exact" : false, "code" : ""}
      }   
    }

    tmsCommonTable.init(options, $table);

    $(document).on("click",".layui-table-link",function(){
      var id = $(this).attr("data-id");
      HC.ajax.get('/ucenter/code/common/shipping/' + id + '.shtml',{
        success: function(data) {
          if(data.wharfs.length){
            parent.layer.open({
              type: 2,
              title: '船公司联系信息',
              shadeClose: true,
              shade: 0.8,
              area: ['70%', '65%'],
              content: 'shippingDetail.html?id=' + id + '' //iframe的url
            });
          }else{
            parent.layer.msg('暂无船公司联系信息！', {icon: 7});
          }
        }
      });
    });
  });
  </script>
  <script type="text/html" id="usernameTpl">
    <p class="layui-table-link" data-id="{{d.id}}" style="cursor:pointer;">{{ d.shippingCode }}</p>
  </script>
</html>